﻿using System.Collections;
using System.Collections.Generic;
using UI;
using UnityEngine;
using UnityEngine.UI;

public class PlayPanel : UIBase
{

    private Button btnStart;

    private Button btnRegist;
    // Start is called before the first frame update
    void Start()
    {
        btnStart = transform.Find("BtnStart").GetComponent<Button>();
        btnRegist = transform.Find("BtnRegist").GetComponent<Button>();
        
        btnStart.onClick.AddListener(StartClick);
        btnRegist.onClick.AddListener(RegistClick);
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public override void OnDestroy()
    {
        base.OnDestroy();
        btnStart.onClick.RemoveAllListeners();
        btnRegist.onClick.RemoveAllListeners();
    }

    private void StartClick()
    {
        Dispatch(AreaCode.UI,UIEvent.START_PANEL_ACTIVE,true);    
    }
    
    private void RegistClick()
    {
        Dispatch(AreaCode.UI,UIEvent.Regist_PANEL_ACTIVE,true);
    }
}
